<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //父类 公共的属性和方法
        class WJL {
            constructor(house, money) {
                this.money = money;
                this.house = house;
            }
            getCar() {
                console.log('我有一仓库的豪车')
            }
        }

        class DG extends WJL {
            constructor(house) {
                super(house)
            }
            getTravel() {
                console.log('我爱旅游')
            }
        }
        let xiaowang = new DG('汤臣一品')
        console.log(xiaowang)

        class Son extends WJL {
            constructor(house, money, girl, car) {
                super(house, money);
                this.girl = girl;
                this.car = car;
            }
            haveFun() {
                console.log('我喜欢打游戏 热爱电竟')
            }
        }
        let WSC = new Son('极品豪宅', '一个小目标', '网红', '玛莎拉蒂-保时捷')
        WSC.haveFun()
        console.log(WSC)
    </script>
</body>

</html>